/*
 * @Author: szx
 * @Date: 2022-01-01 13:43:44
 * @LastEditTime: 2022-01-01 13:46:14
 * @Description:
 * @FilePath: \leetcode\2000-2099\2022\2022.js
 */
/**
 * @param {number[]} original
 * @param {number} m
 * @param {number} n
 * @return {number[][]}
 */
var construct2DArray = function (original, m, n) {
    const len = original.length;
    if (len != m * n) {
        return [];
    }
    const res = [];
    for (let i = 0; i < m; i++) {
        let tmp = [];
        for (let j = 0; j < n; j++) {
            tmp.push(original[i * n + j]);
        }
        res.push(tmp.slice());
    }
    return res;
};
